package com.nebula;

import com.nebula.tcp.server.NebulaNettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.Async;

/**
 * 启动程序
 *
 * @author xuexin_419
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class NebulaApplication implements CommandLineRunner
{
    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(NebulaApplication.class, args);
        System.out.println("          (♥◠‿◠)ﾉﾞ  nebula-netty-str（星云物联网字符串传输框架）系统启动成功   ლ(´ڡ`ლ)ﾞ  \n"   );
    }


    @Async
    @Override
    public void run(String... args) throws Exception {
        //**
        // * 使用异步注解方式启动netty服务端服务
        //*
        new NebulaNettyServer().bind(19183);
    }
}
